package com.bed.lovewithpatientbed.service.impl;

import com.bed.lovewithpatientbed.dao.RoleDao;
import com.bed.lovewithpatientbed.pojo.Role;
import com.bed.lovewithpatientbed.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author xuxiaoding
 * @version 1.0.0
 * @ClassName RoleServiceImpl.java
 * @Description TODO
 */
@Service
public class RoleServiceImpl implements IRoleService {

    private RoleDao roleDao;
    @Autowired
    public void setRoleDao(RoleDao roleDao) {
        this.roleDao = roleDao;
    }

    @Override
    public Role retrieveRoleByRoleId(Integer roleId) {
        if (roleId == null || roleId < 1) {
            return null;
        }

        return roleDao.selectByPrimaryKey(roleId);
    }
}
